import request from '@/utils/request'

export function addCarousel(data) { //添加轮播
  return request({
    url: '/cms/banner',
    method: 'post',
    data
  })
}

export function carouselList (data) {//轮播图列表
  JSON.stringify(data)
  return request({
    url: '/cms/banner',
    method: 'get',
    params : data
  })
}

export function delCarousel (id) {//删除轮播
  return request({
    url: '/cms/banner/' + id,
    method: 'DELETE',
    // params: id
  })
}

export function allChannel () {//获取主渠道子渠道
  return request({
    url :'/communal/communal-channel/all',
    method: 'get',
  })
}

export function compileChannel (bannerId) {//编辑轮播
  return request({
    url :'/cms/banner',
    method: 'put',
    data : bannerId
  })
}
